package edu.ustb.mis.dm.impl.algorithm;

import edu.ustb.mis.dm.interfaces.algorithm.ClusterAlgorithm;
import edu.ustb.mis.dm.model.ClusterResult;

public class ECABOSFV extends WCABOSFV implements ClusterAlgorithm<ClusterResult> {
	public ECABOSFV(final String data_set_name) {
		super(data_set_name);
	}

	/**
	 * 计算两个元素间的差异度
	 * 
	 * @param j
	 */
	@Override
	protected float calculateDissimilarity(final int j) {
		clusterResult = clusterResultList.get(j);
		tmp_clusterResult.clearSet();
		tmp_clusterResult.init(clusterResult.getSameSet(), clusterResult.getAllSet());
		tmp_clusterResult.contrast(instance.getAttributes());
		return (float) ( (tmp_clusterResult.diffSize()) / (tmp_clusterResult.sameSize() * Math.pow(tmp_clusterResult.nextSize(), 0.5)));
	}
}
